#ifndef INCLUDED_ENEMY_H
#define INCLUDED_ENEMY_H
#include <SGE.h>
using namespace SGE;
class IsometricMap;
class Character;
enum IdleStateEnemy
{
	E_topLeft,
	E_topRight,
	E_bottomLeft,
	E_bottomRight,
	E_attack,
	E_dead
};
enum MovementAnimationEnemy
{
	E_leftRight,
	E_rightLeft,
	E_topBottom,
	E_BottomRight,
	E_idle
};


class Enemy
{
public:
	Enemy();
	~Enemy();

	void StartMoving(SVector2 pos);
	void SetEnemyPos(SVector2 pos);
	SVector2 GetEnemyPos() const;
	bool IsClicked();
	
	bool GetReadyStatus() const {return mIsClicked;};
	void SetMoving(bool move);
	bool GetMoving(bool move) const	{return mIsMoving;};
	bool IsLeft()const;

	void Load();
	void Unload();
	void Update(float deltaTime);
	void Render(const SVector2& viewOffset);
	SVector2 Action(const IsometricMap map);
	int GetHealth();
	int GetMovement();
	int GetAttack() const;
	int GetDefence();
	int GetMagic();

	int SetHealth(int num);
	int SetMovement(int num);
	int SetAttack(int num);
	int SetDefence(int num);
	int SetMagic(int num);

	void SetState(const IdleStateEnemy* state);
	void GetState() const;
	void UpdateState();

	void RenderLeftRightAnimation();
	void RenderRightLeftAnimation();

	void Defend(const Character& attacker);
	
private:
	SGE_Sprite mEnemySprite[E_dead];
	SGE_Sprite mMovementLeftRight;
	SGE_Sprite mMovementRightLeft;

	SVector2 mCharPos;
	SVector2 mTempCharPos;
	IdleStateEnemy mCurrentState;
	SVector2 mVelocity;
	bool mIsClicked
		,	mIsMoving;
	int mHealth,
		mMovement,
		mAttack,
		mDefence,
		mMagic;
};
#endif